//////////////////////////////////////////////////////////////////////
//
//  CryEngine Source code
//	
//	File:CVars.h
//  Implementation of CVars class
//
//	History:
//	September 23, 2004: Created by Ivo Herzeg <ivo@crytek.de>
//
//////////////////////////////////////////////////////////////////////
# pragma once

#ifndef _CRY_ANIMATION_CVARS_H_
#define _CRY_ANIMATION_CVARS_H_


//////////////////////////////////////////////////////////////////////////
// console variable interfaces.
// In an instance of this class (singleton for now), there are all the interfaces
// of all the variables needed for the Animation subsystem.
//////////////////////////////////////////////////////////////////////////
struct Console;
extern Console g_Consoleself;




#define SKIPLOADTHINFAT_START_VAL 0





#define USE_FACIAL_ANIMATION_FRAMERATE_LIMITING 0


struct Console
{
	Console();
	//The base class of the character-manager is a SINGLETON object
	//Its impossible to remove this object or to create another instance of the console
	static ILINE Console& GetInst()
	{		
		return g_Consoleself;
	}

	enum {nDefaultAnimWarningLevel = 2};

	enum 
	{
		ApplyJointVelocitiesDisabled=0,
		ApplyJointVelocitiesPhysics,
		ApplyJointVelocitiesAnimation,
	};

	void Init();
	const char* ca_CharEditModel;
	string ca_DebugTextTarget;
	uint32 ca_DebugTextLayer;

	DeclareConstIntCVar(ca_DrawAimIKVEGrid, 0);
	DeclareConstIntCVar(ca_DrawVEGInfo, 0);
	DeclareConstIntCVar(ca_DrawAimPoses, 0);
	DeclareConstIntCVar(ca_DrawBBox,0);
	DeclareConstIntCVar(ca_DrawSkeleton, 0);
	DeclareConstIntCVar(ca_DrawDecalsBBoxes, 0);
	DeclareConstIntCVar(ca_DrawPositionPre, 0);
	DeclareConstIntCVar(ca_DrawPositionPost, 0);
	DeclareConstIntCVar(ca_DrawEmptyAttachments, 0);
	DeclareConstIntCVar(ca_DrawLookIK, 0);
	DeclareConstIntCVar(ca_PrintDesiredSpeed, 0);
	DeclareConstIntCVar(ca_SkipLoadThinFat, SKIPLOADTHINFAT_START_VAL);
	DeclareConstIntCVar(ca_DrawWireframe, 0);
	DeclareConstIntCVar(ca_DrawTangents, 0);
	DeclareConstIntCVar(ca_DrawBinormals, 0);
	DeclareConstIntCVar(ca_DrawNormals, 0);
	DeclareConstIntCVar(ca_DrawFootPlants, 0);
	DeclareConstIntCVar(ca_FootAnchoring, 0);
	DeclareConstIntCVar(ca_GroundAlignment, 1);
	DeclareConstIntCVar(ca_DrawAttachments, 1);
	DeclareConstIntCVar(ca_DrawFaceAttachments, 1);
	DeclareConstIntCVar(ca_DrawAttachmentOBB, 0);
	DeclareConstIntCVar(ca_DrawBaseMesh, 1);
	DeclareConstIntCVar(ca_DrawLocator, 0);
	DeclareConstIntCVar(ca_DrawIdle2MoveDir, 0);
	DeclareConstIntCVar(ca_DrawCGA, 1);
	DeclareConstIntCVar(ca_DrawCHR, 1);
	DeclareConstIntCVar(ca_DrawCGAAsSkin, 0);
	DeclareConstIntCVar(ca_DrawCC, 1);
	DeclareConstIntCVar(ca_DebugAnimMemTracking, 0);
	DeclareConstIntCVar(ca_DebugText, 0);
	DeclareConstIntCVar(ca_DebugCommandBuffer, 0);
	DeclareConstIntCVar(ca_DebugSubstateTransitions, 0);
	DeclareConstIntCVar(ca_DebugFacial, 0);
	DeclareConstIntCVar(ca_DebugFacialEyes, 0);
	DeclareConstIntCVar(ca_DebugFootPlants, 0);
	DeclareConstIntCVar(ca_DebugAnimationStreaming, 0);
	DeclareConstIntCVar(ca_DebugCriticalErrors, 0);
	DeclareConstIntCVar(ca_SmoothStrafe, 1);
	DeclareConstIntCVar(ca_NoDeform, 0);
	DeclareConstIntCVar(ca_UseIMG_CAF, 1);
	DeclareConstIntCVar(ca_UseIMG_AIM, 1);
	DeclareConstIntCVar(ca_UseMorph, 1);



	DeclareConstIntCVar(ca_NoAnim, 0);
	DeclareConstIntCVar(ca_UsePhysics, 1);
	DeclareConstIntCVar(ca_UseLookIK, 1);
	DeclareConstIntCVar(ca_UseAimIK, 1);
	DeclareConstIntCVar(ca_UseAimIKRefPose, 0);
	DeclareConstIntCVar(ca_UseFacialAnimation, 1);
	DeclareConstIntCVar(ca_RandomScaling, 0);
	DeclareConstIntCVar(ca_UseAllJoints, 1);
	DeclareConstIntCVar(ca_ForceUpdateSkeletons, 0);
	DeclareConstIntCVar(ca_ApplyJointVelocitiesMode, 2);
	DeclareConstIntCVar(ca_UseDecals, 0);
	DeclareConstIntCVar(ca_AnimWarningLevel, 3);
	DeclareConstIntCVar(ca_KeepModels, 0);
	DeclareConstIntCVar(ca_DebugModelCache, 0);
	DeclareConstIntCVar(ca_DebugAnimUpdates, 0);
	DeclareConstIntCVar(ca_DebugAnimUsage, 0);
	DeclareConstIntCVar(ca_DebugAnimUsageOnFileAccess, 0);
	DeclareConstIntCVar(ca_StoreAnimNamesOnLoad, 0);
	DeclareConstIntCVar(ca_UnloadAnimationCAF, 1);
	DeclareConstIntCVar(ca_UnloadAnimationDBA, 1);
	DeclareConstIntCVar(ca_DumpUsedAnims, 0);
	DeclareConstIntCVar(ca_LoadUncompressedChunks, 0);
	DeclareConstIntCVar(ca_eyes_procedural, 1);
	DeclareConstIntCVar(ca_lipsync_phoneme_offset, 20);
	DeclareConstIntCVar(ca_lipsync_phoneme_crossfade, 70);
	DeclareConstIntCVar(ca_lipsync_debug, 0);
	DeclareConstIntCVar(ca_DebugADIKTargets, 0);
	DeclareConstIntCVar(ca_DebugCaps, 0);
	DeclareConstIntCVar(ca_SaveAABB, 0);
	DeclareConstIntCVar(ca_FPWeaponInCamSpace, 1);
	DeclareConstIntCVar(ca_UseAnimationsCache, 0);
	DeclareConstIntCVar(ca_DebugSkeletonEffects, 0);
	DeclareConstIntCVar(ca_EnableAssetTurning, 1);
	DeclareConstIntCVar(ca_EnableAssetStrafing, 1);
	DeclareConstIntCVar(ca_AMC, 1);
	DeclareConstIntCVar(ca_AMC_SmoothTurn, 1);
	DeclareConstIntCVar(ca_cloth_vars_reset, 2);
	DeclareConstIntCVar(ca_fullAnimStatistics, 0);
	DeclareConstIntCVar(ca_SerializeSkeletonAnim, 0);
	DeclareConstIntCVar(ca_LockFeetWithIK, 1);
#if USE_FACIAL_ANIMATION_FRAMERATE_LIMITING
	DeclareConstIntCVar(ca_FacialAnimationFramerate, 20);
#endif
	DeclareConstIntCVar(ca_AllowMultipleEffectsOfSameName, 1);
	DeclareConstIntCVar(ca_UseAssetDefinedLod, 0);
	DeclareConstIntCVar(ca_PrecacheAnimationSets, 0);
	DeclareConstIntCVar(ca_DisableAnimationUnloading, 0);

	DeclareConstIntCVar(ca_Validate, 0);
	
	// Anim Actions
	DeclareConstIntCVar(ca_AnimActionDebug, 0);

	// Command Buffer
	DeclareConstIntCVar(ca_UseJointMasking, 1);

	// Multi-Threading
	DeclareConstIntCVar(ca_disable_thread, 1);
	DeclareConstIntCVar(ca_thread, 1);
	DeclareConstIntCVar(ca_thread0Affinity, 5);
	DeclareConstIntCVar(ca_thread1Affinity, 3);

	// vars in console .cfgs
	int32 ca_physicsProcessImpact;
	int32 ca_MemoryUsageLog;

	int32 ca_ParametricPoolSize;

	// cvars used in the game
	int32 ca_GameControlledStrafing;
	DeclareConstIntCVar(ca_UseOldStrafeSmoothing, 1);

	f32 ca_lipsync_vertex_drag;
	f32 ca_lipsync_phoneme_strength;
	f32 ca_DecalSizeMultiplier;
	f32 ca_DeathBlendTime;
	f32 ca_FacialAnimationRadius;
	f32 ca_travelSpeedScaleMin;
	f32 ca_travelSpeedScaleMax;
	f32 ca_lod_ratio;
	f32 ca_AttachmentCullingRation;
	f32 ca_AMC_TurnLeaning;
	f32 ca_cloth_max_timestep;
	f32 ca_cloth_max_safe_step;
	f32 ca_cloth_stiffness;
	f32 ca_cloth_thickness;
	f32 ca_cloth_friction;
	f32 ca_cloth_stiffness_norm;
	f32 ca_cloth_stiffness_tang;
	f32 ca_cloth_damping;
	f32 ca_cloth_air_resistance;

	f32 ca_MotionBlurMovementThreshold;

private:

//	~Console() {};
//	Console(const Console&);
	void operator=(const Console&);

} _ALIGN(128);


#endif // _3DENGINE_CVARS_H_
